home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_asm / oopasm / cursor.mac < prev    next >
Encoding:
Text File  |  1990-12-14  |  1.9 KB  |  72 lines

  1. COMMENT    %
  2. ============================================================================
  3. Sets the cursor type.
  4.  
  5. ===========================================================================%
  6. setCursorType    MACRO    Start,End
  7.     mov    ch,Start        ;Cursor start/end lines in cx
  8.     mov    cl,End
  9.     mov    ah,1            ;Set cursor type function code
  10.     int    10h            ;Video I/O interrupt
  11.     ENDM
  12.  
  13.  
  14.  
  15. COMMENT    %
  16. ============================================================================
  17. Gets the current cursor type.
  18.  
  19. ===========================================================================%
  20. getCursorType    MACRO    Start,End,Page
  21.     mov    ah,3            ;Read cursor posn function code
  22.     IFNB    <Page>            ;If given display page
  23.     mov    bh,Page            ;Pass it in bh
  24.     ELSE
  25.     mov    bh,0            ;Otherwise use display page zero
  26.     ENDIF
  27.     int    10h            ;Read cursor posn
  28.     mov    Start,ch        ;Retrun cursor start line
  29.     mov    End,cl            ;Retrun cursor end line
  30.     ENDM
  31.  
  32.  
  33. COMMENT    %
  34. ============================================================================
  35. Positions the cursor.
  36.  
  37. ===========================================================================%
  38. setCur    MACRO    Row,Col,Page
  39.     IFNB    <Page>            ;If given display page
  40.     mov    bh,Page            ;Pass it in bh
  41.     ELSE
  42.     mov    bh,0            ;Otherwise use display page zero
  43.     ENDIF
  44.     IFDIF    <Row>,<dh>
  45.     mov    dh,Row            ;Pass row number in dh
  46.     ENDIF
  47.     IFDIF    <Col>,<dl>
  48.     mov    dl,Col            ;Pass column number in dl
  49.     ENDIF
  50.     mov    ah,2            ;Pass set cursor service number in ah
  51.     int    10h
  52.     ENDM
  53.  
  54.  
  55.  
  56. COMMENT    %
  57. ============================================================================
  58. Moves the cursor right one column.
  59.  
  60. ===========================================================================%
  61. cursorRight    MACRO    Spaces
  62.     mov    ah,3            ;Pass read cursor service number
  63.     int    10h            ;Returns cursor position in dx
  64.     IFNB    <Spaces>
  65.     add    dl,Spaces        ;Advance cursor Spaces
  66.     ELSE
  67.     inc    dl            ;Advance cursor one space
  68.     ENDIF
  69.     mov    ah,2            ;Pass set cursor service number in ah
  70.     int    10h            ;Advance cursor
  71.     ENDM
  72.